import 'package:flutter/services.dart';

class MusicPlayer{
  static const channel = "music_channel";

  static Future<int> lead(String path, {int loop = 0}) async {
    return await MethodChannel(channel).invokeMethod("lead", {"path" : path, "loop" : loop});
  }

  static Future<void> play(int id) async {
    await MethodChannel(channel).invokeMethod("play", {"id" : id});
  }

  static Future<void> stop(int id) async {
    await MethodChannel(channel).invokeMethod("stop", {"id" : id});
  }
}